import * as Koa from 'koa';
import { route, RouteOptionsVerify, ServiceManager } from "../../common";
import { DataRPermitsService } from '../../service/datarPermitsServices';

const dsvr = ServiceManager.Current.GetService<DataRPermitsService>("DataRPermitsService");

class DataRPermitController {
    @route(new RouteOptionsVerify('GET', '/api/datarPermits'))
    async queryDataRPermits(ctx: Koa.Context, next) {
        let queryParams = ctx.query;
        ctx.response.body = await dsvr.QueryDataRPermits(queryParams);
        await next();
    }
    @route(new RouteOptionsVerify('GET', '/api/datarPermits/:id'))
    async getDataRPermitInfoById(ctx: Koa.Context, next) {
        ctx.response.body = null;
        await next();
    }
    @route(new RouteOptionsVerify('POST', '/api/datarPermits'))
    async createDataRPermit(ctx: Koa.Context, next) {
        ctx.response.body = null;
        await next();
    }
    @route(new RouteOptionsVerify('PUT', '/api/datarPermits'))
    async updateDataRPermit(ctx: Koa.Context, next) {
        ctx.response.body = null;
        await next();
    }
    @route(new RouteOptionsVerify('DELETE', '/api/datarPermits'))
    async deleteDataRPermit(ctx: Koa.Context, next) {
        ctx.response.body = null;
        await next();
    }
}